<template lang="html">
  <div class="wrapper">
    <div class="container">
      <!-- stars -->
      <div class="star star-1"></div>
      <div class="star star-2"></div>
      <div class="star star-3"></div>
      <!-- clouds -->
      <div class="cloud-group-1">
        <div class="cloud cloud-1"></div>
        <div class="cloud cloud-2"></div>
        <div class="cloud cloud-3"></div>
        <div class="cloud cloud-4"></div>
        <div class="cloud cloud-5"></div>
        <div class="cloud cloud-6"></div>
      </div>
      <div class="cloud-group-2">
        <div class="cloud cloud-1"></div>
        <div class="cloud cloud-2"></div>
        <div class="cloud cloud-3"></div>
        <div class="cloud cloud-4"></div>
        <div class="cloud cloud-5"></div>
        <div class="cloud cloud-6"></div>
      </div>
      <div class="cloud-group-3">
        <div class="cloud cloud-1"></div>
        <div class="cloud cloud-2"></div>
        <div class="cloud cloud-3"></div>
        <div class="cloud cloud-4"></div>
        <div class="cloud cloud-5"></div>
        <div class="cloud cloud-6"></div>
      </div>
      <!-- orbits -->
      <div class="orbit orbit-1"></div>
      <div class="orbit orbit-2"></div>
      <div class="orbit orbit-3"></div>
      <div class="orbit orbit-4"></div>
      <div class="orbit orbit-5"></div>
      <div class="orbit orbit-6"></div>
      <!-- main planet -->
      <div class="ring-before"></div>
      <div class="ring-bigger-before"></div>
      <div class="planet"></div>
      <div class="ring-after"></div>
      <div class="ring-bigger-after"></div>
      <!-- sub planet -->
      <div class="sub-planet"></div>
    </div>
  </div>
</template>

<script>
export default {
}
</script>

<style lang="scss" scoped>
// variables
$orange-light: #fecf4e;
$orange: #a62a44;
$orange-dark: #310441;

$blue-light: #70a27d;
$blue: #4552a1;
$blue-dark: #371a6a;

$bg-light: #ee7752;
$bg-semi: #e73c7e;
$bg-middle: #23a6d5;
$bg-dark: #23d5ab;

// main
.wrapper {
  background: #fafaf0;
}
.container {
  position: relative;
  width: 300px;
  height: 300px;
  margin: 100px auto;
  background: linear-gradient(-45deg, $bg-light, $bg-semi, $bg-middle, $bg-dark);
  background-size: 400% 400%;
  animation: daylight 15s ease infinite;
  border-radius: 50%;
  border: 10px solid white;
  overflow: hidden;
  box-shadow: 0 0 20px rgba(black, .3),
    inset 0 0 0 15px rgba(black, .05),
    inset 0 0 0 30px rgba(black, .05),
    inset 0 0 0 45px rgba(black, .05),
    inset 0 0 0 60px rgba(black, .05),
    inset 0 0 0 75px rgba(black, .05),
    inset 0 0 0 90px rgba(black, .05);
}
.planet {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 120px;
  height: 120px;
  background: linear-gradient(to bottom, $orange-light 1%, $orange 50%, $orange-dark 100%);
  border-radius: 50%;
  transform: rotate(-15deg) translate(-35%, -55%);
}

@supports not (clip-path: inset(50% 0 0 0 )) {
  .ring-before,
  .ring-after,
  .ring-bigger-before,
  .ring-bigger-after {
    display: none;
  }
}
.ring-before,
.ring-after,
.ring-bigger-before,
.ring-bigger-after {
  content: "";
  width: 126px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(#f8c54d, .8);
  position: absolute;
  top: 125px;
  left: 84px;
  transform: skew(-54deg);
}
.ring-bigger-before,
.ring-bigger-after {
  transform: skew(-54deg) scale(1.3);
  border-color: rgb(211, 188, 104);
}
.ring-before,
.ring-bigger-before {
  z-index: 3;
  clip-path: inset(50% 0 0 0);
}
.ring-after,
.ring-bigger-after {
  z-index: 1;
  clip-path: inset(0 0 50% 0);
}
.sub-planet {
  position: absolute;
  top: 24%;
  left: 75%;
  z-index: 4;
  width: 35px;
  height: 35px;
  background: linear-gradient(to bottom, $blue-light 1%, $blue 50%, $blue-dark 100%);
  border-radius: 50%;
  transform: rotate(-15deg);
}
.orbit {
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9;
}
@for $i from 1 through 6 {
  .orbit-#{$i} {
    animation: orbit-#{$i} 5s * $i linear infinite;
  }
  @keyframes orbit-#{$i} {
    from { transform: rotate(0deg) translateX(50px + 15px * $i) rotate(0deg); }
    to { transform: rotate(360deg) translateX(50px + 15px * $i) rotate(-360deg);}
  }
}

.cloud {
  background: #f1f1f1;
  width: 100px;
  height: 30px;
  position: absolute;
  border-radius: 50%;
  bottom: -5px;
  box-shadow: 0 0 40px rgba(black, .1);
  &:before,
  &:after {
    content: "";
    background: #f1f1f1;
    border-radius: 50%;
    position: absolute;
  }
  &:before {
    width: 50px;
    height: 50px;
    bottom: 2px;
    left: 5px;
  }
  &:after {
    width: 40px;
    height: 40px;
    bottom: 2px;
    right: 15px;
  }
}
.cloud-group-1,
.cloud-group-2,
.cloud-group-3 {
  position: absolute;
  bottom: 0;
  width: 211px;
  height: 100px;
  opacity: .2;
}
.cloud-group-1 {
  bottom: -5px;
}
.cloud-group-2 {
  transform: scale(2);
  bottom: 20px;
  left: -50px;
}
.cloud-group-3 {
  transform: scale(3);
  bottom: 100px;
  left: -24px;
}
.cloud-2 { left: 10px; }
.cloud-3 { right: 10px; }
.cloud-4 { right: 184px; bottom: 0; }
.cloud-5 { right: 24px; bottom: 12px; }
.cloud-6 { right: -45px; bottom: 9; }

.star {
  position: absolute;
  left: 0;
  top: 50px;
  width: 1px;
  height: 1px;
  background-color: white;
  animation: shooting 5s linear infinite;
  &:before {
    content: "";
    position: absolute;
    width: 100px;
    height: 1px;
    right: 1px;
    top: 0;
    background: linear-gradient(to right, rgba(black, 0) 0%, rgba(white, .4) 100%);
  }
}
.star-2 { top: 100px; animation: shooting 8s 1s linear infinite; }
.star-3 { top: 250px; animation: shooting 3s 2s linear infinite; }

@keyframes daylight {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes shooting {
  from { left: -100px; }
  to { left: calc(100% + 100px); }
}
</style>
